<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.util.*"%>

<%
/*
新增执行方法jsp
*/
DBO db=new DBO();//初始数据库链接
request.setCharacterEncoding("utf-8");//设置字符集
ResultSet rs=null;//声明结果集
			String id=(String)request.getParameter("id");//变量:id
			String usercount=(String)request.getParameter("usercount");//变量:容纳人数
			String name=(String)request.getParameter("name");//变量:教室名称
			String status=(String)request.getParameter("status");//变量:状态
String sql="";//保存sql
	sql="insert into actitvtyroom(  usercount, name, status)values('"+usercount+"','"+name+"','"+status+"')";;//声明sql
	int row=1;///定义执行结果

	try{


	//int row =0;
		row=db.update(sql);
}catch(Exception e){
System.out.println(e.toString());}
if(row==1){
out.println("<script>");
out.println("alert('操作成功');");
out.println("window.location='add.jsp'");
out.println("</script>");
}else{
out.println("<script>");
out.println("alert('操作失败');");
out.println("window.location='add.jsp'");
out.println("</script>");
}
db.close();
%>

